//
//  WFTabBarViewController.m
//  谷居
//
//  Created by dllo on 16/6/16.
//  Copyright © 2016年 刘万方. All rights reserved.
//

#import "WFTabBarViewController.h"
#import "WFNavigationViewController.h"
#import "WFGuideViewController.h"
#import "WFCaseViewController.h"
#import "WFDesignerViewController.h"
#import "WFPictureViewController.h"
@interface WFTabBarViewController ()

@end

@implementation WFTabBarViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self addChildViewControllers];
    // Do any additional setup after loading the view.
}
/** 添加子控制器 */
- (void)addChildViewControllers {
    WFCaseViewController *caseVC = [[WFCaseViewController alloc] init];
    [self addChildViewController:caseVC withTitle:@"装修案例" withImageName:@"装修案例.png" height:84];
    [caseVC release];
    
    WFPictureViewController *picVC = [[WFPictureViewController alloc] init];
    [self addChildViewController:picVC withTitle:@"图库" withImageName:@"图库.png" height:84];
    [picVC release];
    
    WFGuideViewController *guideVC = [[WFGuideViewController alloc] init];
    [self addChildViewController:guideVC withTitle:@"装修攻略" withImageName:@"装修攻略.png" height:84];
    [guideVC release];
    
    WFDesignerViewController *desVC = [[WFDesignerViewController alloc] init];
    [self addChildViewController:desVC withTitle:@"设计师" withImageName:@"设计师.png" height:64];
    [desVC release];
    
    
    
    
}
- (void)addChildViewController:(UIViewController *)childController withTitle:(NSString *)title withImageName:(NSString *)imageName height:(NSInteger)height {
    childController.tabBarItem.image = [UIImage imageNamed:imageName];
    childController.tabBarItem.title = title;
    WFNavigationViewController *naVC =[[WFNavigationViewController alloc] initWithRootViewController:childController];
//    naVC.navigationBar.frame = CGRectMake(0, 0, SCREEN_WIDTH, height);
//    naVC.view.backgroundColor = [UIColor whiteColor];
    [self addChildViewController:naVC];
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
